package cn.zysheep.factory.factory_method;

/**
 * @ClassName: CoffeeStore
 * @Description: 咖啡店
 * @Author: lyw
 * @Date: 2022/10/17 22:46
 */
public class CoffeeStore {

    private CoffeeFactory coffeeFactory;

    public void setCoffeeFactory(CoffeeFactory coffeeFactory) {
        this.coffeeFactory = coffeeFactory;
    }

    /**
     * 点咖啡
     * @return
     */
    public Coffee orderCoffee() {
        Coffee coffee = coffeeFactory.createCoffee();
        coffee.addsugar();
        coffee.addMilk();
        return coffee;
    }
}
